package zhangcy.day0110;

import zhangcy.day0109.qingyoutravel.dao.TourRouteDao;
import zhangcy.day0109.qingyoutravel.dao.impl.TourRouteDaoImpl;
import zhangcy.day0109.qingyoutravel.po.TourRoute;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 *
 */
public class jstlServicePlatformServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        TourRouteDao tourRouteDao = new TourRouteDaoImpl();
        List<TourRoute> tourRouteList = tourRouteDao.queryAllTourRoutes();
        request.setAttribute("tourRouteList", tourRouteList);
        request.getRequestDispatcher("jsp/zhangcy/day0110/jstl-service-platform.jsp").forward(request, response);
    }
}
